package vsjgl;

public class SpaceInvaders {
	private Square[][] space = new Square[11][11];
	public SpaceInvaders(int width,int height,int x,int y){
		
		space[0][0]= null;
		space[1][0]= null;
		space[2][0]= new Square(width,height,x+3*width,y+height);
		space[3][0]= null;
		space[4][0]= null;
		space[5][0]= null;
		space[6][0]= null;
		space[7][0]= null;
		space[8][0]=  new Square(width,height,x+9*width,y+height);
		space[9][0]= null;
		space[10][0]= null;
		
		space[0][1]= null;
		space[1][1]= null;
		space[2][1]= null;
		space[3][1]= new Square(width,height,x+4*width,2*height+y);
		space[4][1]= null;
		space[5][1]= null;
		space[6][1]= null;
		space[7][1]= new Square(width,height,x+8*width,2*height+y);
		space[8][1]= null;
		space[9][1]= null;
		space[10][1]= null;
		
		space[0][2]= null;
		space[1][2]= null;
		space[2][2]= new Square(width,height,x+3*width,y+height*3);
		space[3][2]= new Square(width,height,x+4*width,y+height*3);
		space[4][2]= new Square(width,height,x+5*width,y+height*3);
		space[5][2]= new Square(width,height,x+6*width,y+height*3);
		space[6][2]= new Square(width,height,x+7*width,y+height*3);
		space[7][2]= new Square(width,height,x+8*width,y+height*3);
		space[8][2]=  new Square(width,height,x+9*width,y+height*3);
		space[9][2]= null;
		space[10][2]= null;
		
		space[0][3]= null;
		space[1][3]= new Square(width,height,x+2*width,y+height*4);
		space[2][3]= new Square(width,height,x+3*width,y+height*4);
		space[3][3]= null;
		space[4][3]= new Square(width,height,x+5*width,y+height*4);
		space[5][3]= new Square(width,height,x+6*width,y+height*4);
		space[6][3]= new Square(width,height,x+7*width,y+height*4);
		space[7][3]= null;
		space[8][3]= new Square(width,height,x+9*width,y+height*4);
		space[9][3]= new Square(width,height,x+10*width,y+height*4);
		space[10][3]= null;
		
		space[0][4]= new Square(width,height,x+1*width,y+height*5);
		space[1][4]=new Square(width,height,x+2*width,y+height*5);
		space[2][4]= new Square(width,height,x+3*width,y+height*5);
		space[3][4]= new Square(width,height,x+4*width,y+height*5);
		space[4][4]= new Square(width,height,x+5*width,y+height*5);
		space[5][4]= new Square(width,height,x+6*width,y+height*5);
		space[6][4]= new Square(width,height,x+7*width,y+height*5);
		space[7][4]= new Square(width,height,x+8*width,y+height*5);
		space[8][4]= new Square(width,height,x+9*width,y+height*5);
		space[9][4]= new Square(width,height,x+10*width,y+height*5);
		space[10][4]= new Square(width,height,x+11*width,y+height*5);
		
		space[0][5]= new Square(width,height,x+1*width,y+height*6);
		space[1][5]= null;
		space[2][5]= new Square(width,height,x+3*width,y+height*6);
		space[3][5]= new Square(width,height,x+4*width,y+height*6);
		space[4][5]= new Square(width,height,x+5*width,y+height*6);
		space[5][5]= new Square(width,height,x+6*width,y+height*6);
		space[6][5]= new Square(width,height,x+7*width,y+height*6);
		space[7][5]= new Square(width,height,x+8*width,y+height*6);
		space[8][5]= new Square(width,height,x+9*width,y+height*6);
		space[9][5]= null;
		space[10][5]= new Square(width,height,x+11*width,y+height*6);
		
		space[0][6]= new Square(width,height,x+1*width,y+height*7);
		space[1][6]=null;
		space[2][6]= new Square(width,height,x+3*width,y+height*7);
		space[3][6]=null;
		space[4][6]= null;
		space[5][6]= null;
		space[6][6]=null;
		space[7][6]= null;
		space[8][6]= new Square(width,height,x+9*width,y+height*7);
		space[9][6]= null;
		space[10][6]= new Square(width,height,x+11*width,y+height*7);
		
		space[0][7]= null;
		space[1][7]= null;
		space[2][7]= null;
		space[3][7]= new Square(width,height,x+4*width,y+height*8);
		space[4][7]= new Square(width,height,x+5*width,y+height*8);
		space[5][7]= null;
		space[6][7]= new Square(width,height,x+7*width,y+height*8);
		space[7][7]= new Square(width,height,x+8*width,y+height*8);
		space[8][7]= null;
		space[9][7]= null;
		space[10][7]= null;
	}
	public void draw(){
		for(int y=0;y<space.length;y++){
			for(int x=0;x<space[0].length;x++){
				if(space[x][y]!=null)
					space[x][y].draw();
			}
		}
	}

}
